package com.example.test3;
import static com.example.test3.MusicServer.play;
import static com.example.test3.MusicServer.stop;
import android.os.Bundle;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity
{
    change example;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        example = (change) findViewById(R.id.gradient);
        ImageView imageView = new ImageView(this);
        imageView.setImageResource(R.mipmap.picture1);
        ImageView imageView2 = new ImageView(this);
        imageView2.setImageResource(R.mipmap.picture2);
        ImageView imageView3 = new ImageView(this);
        imageView3.setImageResource(R.mipmap.picture3);
        ImageView imageView4 = new ImageView(this);
        imageView4.setImageResource(R.mipmap.picture4);
        List<ImageView> list = new ArrayList<>();
        list.add(imageView);
        list.add(imageView2);
        list.add(imageView3);
        list.add(imageView4);
        example.setImageViews(list);
    }
    @Override
    protected void onPause()
    {
        super.onPause();
        stop(this);
    }
    @Override
    protected void onResume()
    {
        super.onResume();
        play(this, R.raw.my_music);
    }
}